﻿<UserControl 
    x:Class="MTGenome.Views.DeckBuilderView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:avalon="clr-namespace:AvalonDock;assembly=AvalonDock"
    xmlns:caliburn="http://www.caliburnproject.org"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:ui="clr-namespace:MTGenome.UI;assembly=MTGenome.UI"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Menu>
            <MenuItem Header="_File">
                <MenuItem Header="_Home" caliburn:Message.Attach="GoHome" caliburn:Action.TargetWithoutContext="{Binding MainWindow}" />
                <MenuItem Header="_New" caliburn:Message.Attach="New" caliburn:Action.TargetWithoutContext="{Binding Deck}">
                    <MenuItem.Icon>
                        <Image Source="{StaticResource AddIcon}" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="_Open" caliburn:Message.Attach="Open" caliburn:Action.TargetWithoutContext="{Binding Deck}" />
                <MenuItem Header="_Save" caliburn:Message.Attach="Save" caliburn:Action.TargetWithoutContext="{Binding Deck}">
                    <MenuItem.Icon>
                        <Image Source="{StaticResource SaveIcon}" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="_Save As" caliburn:Message.Attach="SaveAs" caliburn:Action.TargetWithoutContext="{Binding Deck}" />
                <MenuItem Header="E_xit" caliburn:Message.Attach="TryClose" caliburn:Action.TargetWithoutContext="{Binding MainWindow}">
                    <MenuItem.Icon>
                        <Image Source="{StaticResource DeleteIcon}" />
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="_View">
                <MenuItem Header="_Search" IsCheckable="True" IsChecked="{Binding IsShown, ElementName=SearchContent}" />
                <MenuItem Header="_Filter" IsCheckable="True" IsChecked="{Binding IsShown, ElementName=FilterContent}" />
                <MenuItem Header="_Card Details" IsCheckable="True" IsChecked="{Binding IsShown, ElementName=CardDetailContent}" />
                <MenuItem Header="_Deck Builder" IsCheckable="True" IsChecked="{Binding IsShown, ElementName=DeckContent}" />
                <MenuItem Header="_Restore Default" caliburn:Message.Attach="RestoreDefaults" />
            </MenuItem>
            <MenuItem Header="_Options">
                <MenuItem Header="_Offline Mode?" IsCheckable="True" IsChecked="{Binding Mode=TwoWay, Path=MainWindow.Offline}" />
            </MenuItem>
            <MenuItem Header="_Help">
                <MenuItem Header="_About" caliburn:Message.Attach="ShowAbout" caliburn:Action.TargetWithoutContext="{Binding MainWindow}">
                    <MenuItem.Icon>
                        <Image Source="{StaticResource AboutIcon}" />
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
        </Menu>
        
        <avalon:DockingManager Grid.Row="1" caliburn:Message.Attach="[Event Loaded] = [Action Loaded($source)]">
            
            <avalon:ResizingPanel Orientation="Horizontal">

                <avalon:ResizingPanel Orientation="Vertical">
                    <avalon:DockablePane>
                        <ui:DockableContentEx x:Name="CardCollectionContent" MinHeight="350" MinWidth="350" ViewModel="{Binding CardCollection}" Title="Collection" HideOnClose="True" />
                    </avalon:DockablePane>
                    <avalon:DocumentPane>
                        <ui:DockableContentEx x:Name="DeckContent" ViewModel="{Binding Deck}" Title="Your Deck" HideOnClose="True" />
                        <ui:DockableContentEx x:Name="CardDetails" ViewModel="{Binding CardDetail}" Title="Card Details" HideOnClose="True" />
                    </avalon:DocumentPane>
                </avalon:ResizingPanel>

                <avalon:ResizingPanel Orientation="Vertical" avalon:ResizingPanel.ResizeWidth="200">
                    <avalon:DockablePane>
                        <ui:DockableContentEx x:Name="FilterContent" ViewModel="{Binding Filter}" Title="Filter" HideOnClose="True" />
                    </avalon:DockablePane>
                    <avalon:DockablePane>
                        <ui:DockableContentEx x:Name="DeckStats" ViewModel="{Binding DeckStats}" Title="Deck Stats" HideOnClose="True" />
                    </avalon:DockablePane>
                </avalon:ResizingPanel>
                
            </avalon:ResizingPanel>
            
        </avalon:DockingManager>
    </Grid>
</UserControl>
